﻿
//Author: 张亚涛
//createtime:2015-12-24 23:21:12
//Description: 

using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Model
{
    public class Order
    {
        public Order()
        { }
        public Order(IDataReader reader)
        {
            _orderID = long.Parse(reader["OrderID"].ToString());
            if (reader["OpenID"] != DBNull.Value)
            {
                _OpenID = reader["OpenID"].ToString();
            }
            if (reader["OrderNo"] != DBNull.Value)
            {
                _orderNo = reader["OrderNo"].ToString();
            }
            if (reader["TrueName"] != DBNull.Value)
            {
                _trueName = reader["TrueName"].ToString();
            }
            if (reader["Mobile"] != DBNull.Value)
            {
                _mobile = reader["Mobile"].ToString();
            }
            if (reader["CarID"] != DBNull.Value)
            {
                _carID = int.Parse(reader["CarID"].ToString());
            }
            if (reader["CarNumber"] != DBNull.Value)
            {
                _carNumber = reader["CarNumber"].ToString();
            }
            if (reader["CarType"] != DBNull.Value)
            {
                _carType = reader["CarType"].ToString();
            }
            if (reader["Address"] != DBNull.Value)
            {
                _address = reader["Address"].ToString();
            }
            if (reader["Lat"] != DBNull.Value)
            {
                _lat = reader["Lat"].ToString();
            }
            if (reader["Lng"] != DBNull.Value)
            {
                _lng = reader["Lng"].ToString();
            }
            if (reader["Interior"] != DBNull.Value)
            {
                _interior = int.Parse(reader["Interior"].ToString());
            }
            if (reader["Times"] != DBNull.Value)
            {
                _times = int.Parse(reader["Times"].ToString());
            }
            if (reader["Price"] != DBNull.Value)
            {
                _price = decimal.Parse(reader["Price"].ToString());
            }
            if (reader["CouponsID"] != DBNull.Value)
            {
                _couponsID = long.Parse(reader["CouponsID"].ToString());
            }
            if (reader["CouType"] != DBNull.Value)
            {
                _couType = int.Parse(reader["CouType"].ToString());
            }
            if (reader["CouponsMoney"] != DBNull.Value)
            {
                _couponsMoney = decimal.Parse(reader["CouponsMoney"].ToString());
            }
            if (reader["Cash"] != DBNull.Value)
            {
                _cash = decimal.Parse(reader["Cash"].ToString());
            }
            if (reader["Pay"] != DBNull.Value)
            {
                _pay = decimal.Parse(reader["Pay"].ToString());
            }
            if (reader["Memo"] != DBNull.Value)
            {
                _memo = reader["Memo"].ToString();
            }
            if (reader["AddDate"] != DBNull.Value)
            {
                _addDate = DateTime.Parse(reader["AddDate"].ToString());
            }
            if (reader["PayType"] != DBNull.Value)
            {
                _payType = int.Parse(reader["PayType"].ToString());
            }
            if (reader["TradeNo"] != DBNull.Value)
            {
                _tradeNo = reader["TradeNo"].ToString();
            }
            if (reader["PayNo"] != DBNull.Value)
            {
                _payNo = reader["PayNo"].ToString();
            }
            if (reader["PayDate"] != DBNull.Value)
            {
                _payDate = DateTime.Parse(reader["PayDate"].ToString());
            }
            if (reader["State"] != DBNull.Value)
            {
                _state = int.Parse(reader["State"].ToString());
            }
            if (reader["UserID"] != DBNull.Value)
            {
                _userID = long.Parse(reader["UserID"].ToString());
            }
            if (reader["UserName"] != DBNull.Value)
            {
                _userName = reader["UserName"].ToString();
            }
            if (reader["UserMobile"] != DBNull.Value)
            {
                _userMobile = reader["UserMobile"].ToString();
            }
            if (reader["StartTime"] != DBNull.Value)
            {
                _startTime = DateTime.Parse(reader["StartTime"].ToString());
            }
            if (reader["EndTime"] != DBNull.Value)
            {
                _endTime = DateTime.Parse(reader["EndTime"].ToString());
            }
            if (reader["RealTime"] != DBNull.Value)
            {
                _realTime = int.Parse(reader["RealTime"].ToString());
            }
            if (reader["Score"] != DBNull.Value)
            {
                _score = int.Parse(reader["Score"].ToString());
            }
            if (reader["Comment"] != DBNull.Value)
            {
                _comment = reader["Comment"].ToString();
            }
        }

        #region 数据库字段
        private long? _orderID;
        private string _OpenID;
        private string _orderNo;
        private string _trueName;
        private string _mobile;
        private int? _carID;
        private string _carNumber;
        private string _carType;
        private string _address;
        private string _lat;
        private string _lng;
        private int? _interior;
        private int _times;
        private decimal _price;
        private long? _couponsID;
        private int? _couType;
        private decimal? _couponsMoney;
        private decimal? _cash;
        private decimal? _pay;
        private string _memo;
        private DateTime? _addDate;
        private int? _payType;
        private string _tradeNo;
        private string _payNo;
        private DateTime? _payDate;
        private int? _state;
        private long? _userID;
        private string _userName;
        private string _userMobile;
        private DateTime? _startTime;
        private DateTime? _endTime;
        private int? _realTime;
        private int? _score;
        private string _comment;
        #endregion

        #region 字段属性
        /// <summary>
        /// 订单ID
        /// </summary>
        public long? OrderID
        {
            set { _orderID = value; }
            get { return _orderID; }
        }
        /// <summary>
        /// 微信ID
        /// </summary>
        public string OpenID
        {
            set { _OpenID = value; }
            get { return _OpenID; }
        }
        /// <summary>
        /// 订单编号
        /// </summary>
        public string OrderNo
        {
            set { _orderNo = value; }
            get { return _orderNo; }
        }
        /// <summary>
        /// 姓名
        /// </summary>
        public string TrueName
        {
            set { _trueName = value; }
            get { return _trueName; }
        }
        /// <summary>
        /// 手机
        /// </summary>
        public string Mobile
        {
            set { _mobile = value; }
            get { return _mobile; }
        }
        /// <summary>
        /// 车辆ID
        /// </summary>
        public int? CarID
        {
            set { _carID = value; }
            get { return _carID; }
        }
        /// <summary>
        /// 车牌号
        /// </summary>
        public string CarNumber
        {
            set { _carNumber = value; }
            get { return _carNumber; }
        }
        /// <summary>
        /// 车型
        /// </summary>
        public string CarType
        {
            set { _carType = value; }
            get { return _carType; }
        }
        /// <summary>
        /// 位置
        /// </summary>
        public string Address
        {
            set { _address = value; }
            get { return _address; }
        }
        /// <summary>
        /// 纬度
        /// </summary>
        public string Lat
        {
            set { _lat = value; }
            get { return _lat; }
        }
        /// <summary>
        /// 经度
        /// </summary>
        public string Lng
        {
            set { _lng = value; }
            get { return _lng; }
        }
        /// <summary>
        /// 是否清洗内饰(1是0否)
        /// </summary>
        public int? Interior
        {
            set { _interior = value; }
            get { return _interior; }
        }
        /// <summary>
        /// 工作时长(分钟)
        /// </summary>
        public int Times
        {
            set { _times = value; }
            get { return _times; }
        }
        /// <summary>
        /// 价格
        /// </summary>
        public decimal Price
        {
            set { _price = value; }
            get { return _price; }
        }
        /// <summary>
        /// 优惠券
        /// </summary>
        public long? CouponsID
        {
            set { _couponsID = value; }
            get { return _couponsID; }
        }
        /// <summary>
        /// 优惠券类型(0：优惠券1：洗车券)
        /// </summary>
        public int? CouType
        {
            set { _couType = value; }
            get { return _couType; }
        }
        /// <summary>
        /// 优惠金额
        /// </summary>
        public decimal? CouponsMoney
        {
            set { _couponsMoney = value; }
            get { return _couponsMoney; }
        }
        /// <summary>
        /// 余额支付
        /// </summary>
        public decimal? Cash
        {
            set { _cash = value; }
            get { return _cash; }
        }
        /// <summary>
        /// 实付金额
        /// </summary>
        public decimal? Pay
        {
            set { _pay = value; }
            get { return _pay; }
        }
        /// <summary>
        /// 备注
        /// </summary>
        public string Memo
        {
            set { _memo = value; }
            get { return _memo; }
        }
        /// <summary>
        /// 下单时间
        /// </summary>
        public DateTime? AddDate
        {
            set { _addDate = value; }
            get { return _addDate; }
        }
        /// <summary>
        /// 支付类型
        /// </summary>
        public int? PayType
        {
            set { _payType = value; }
            get { return _payType; }
        }
        /// <summary>
        /// 商户交易单号
        /// </summary>
        public string TradeNo
        {
            set { _tradeNo = value; }
            get { return _tradeNo; }
        }
        /// <summary>
        /// 微信交易单号
        /// </summary>
        public string PayNo
        {
            set { _payNo = value; }
            get { return _payNo; }
        }
        /// <summary>
        /// 交易时间
        /// </summary>
        public DateTime? PayDate
        {
            set { _payDate = value; }
            get { return _payDate; }
        }
        /// <summary>
        /// 状态(0:未付款 1:排队中 2:洗车中 3:完成 4:已派单 9:已取消)
        /// </summary>
        public int? State
        {
            set { _state = value; }
            get { return _state; }
        }
        /// <summary>
        /// 洗车员工ID
        /// </summary>
        public long? UserID
        {
            set { _userID = value; }
            get { return _userID; }
        }
        /// <summary>
        /// 洗车员工姓名
        /// </summary>
        public string UserName
        {
            set { _userName = value; }
            get { return _userName; }
        }
        /// <summary>
        /// 洗车员工电话
        /// </summary>
        public string UserMobile
        {
            set { _userMobile = value; }
            get { return _userMobile; }
        }
        /// <summary>
        /// 洗车开始时间
        /// </summary>
        public DateTime? StartTime
        {
            set { _startTime = value; }
            get { return _startTime; }
        }
        /// <summary>
        /// 洗车结束时间
        /// </summary>
        public DateTime? EndTime
        {
            set { _endTime = value; }
            get { return _endTime; }
        }
        /// <summary>
        /// 实际工作时长(分钟)
        /// </summary>
        public int? RealTime
        {
            set { _realTime = value; }
            get { return _realTime; }
        }
        /// <summary>
        /// 评分
        /// </summary>
        public int? Score
        {
            set { _score = value; }
            get { return _score; }
        }
        /// <summary>
        /// 评价
        /// </summary>
        public string Comment
        {
            set { _comment = value; }
            get { return _comment; }
        }
        #endregion

        #region 扩展属性
        private string _carColor;
        /// <summary>
        /// 车辆颜色
        /// </summary>
        public string CarColor
        {
            set { _carColor = value; }
            get { return _carColor; }
        }
        private string _stateName;
        /// <summary>
        /// 状态名称
        /// </summary>
        public string StateName
        {
            set { _stateName = value; }
            get { return _stateName; }
        }
        private string _waitTip = "";
        /// <summary>
        /// 排队提醒
        /// </summary>
        public string WaitTip
        {
            set { _waitTip = value; }
            get { return _waitTip; }
        }
        #endregion
    }
}